package com.core.service.jdbc;

import java.util.ResourceBundle;

public class JdbcConfig {

	private static JdbcConfig configuration = null;
	private static ResourceBundle resourceBundle = null;
	private static final String CONFIG_FILE = "jdbc";

	private JdbcConfig() {
		resourceBundle = ResourceBundle.getBundle(CONFIG_FILE);
	}

	public synchronized static JdbcConfig getInstance() {
		if (null == configuration) {
			configuration = new JdbcConfig();
		}

		return (configuration);
	}

	public String getValue(String key) {
		return (resourceBundle.getString(key));
	}

	public int getIntValue(String key) {
		String value = resourceBundle.getString(key);
		try {
			return Integer.parseInt(value);
		} catch (Exception e) {
			return 0;
		}
	}
}
